package day4;

import com.sc.mapper.TuserMapper;
import com.sc.pojo.Trolemenu;
import com.sc.pojo.Tuser;
import com.sc.util.MybatisUtil;
import org.junit.Test;

public class HomeWork {
    @Test
    public void selectAll() {
        TuserMapper mapper = MybatisUtil.getMapper(TuserMapper.class);
        for (Tuser t : mapper.selectAll()) {
            System.out.println(t.getId());
            System.out.println(t.getUsername());
            System.out.println(t.getPassword());
            System.out.println(t.getRole().getRolename());
            for(Trolemenu u :t.getRole().getMenu()){
                System.out.println(u.getMenu().getName());
                System.out.println(u.getMenu().getUrl());
            }
            System.out.println("--------------------------------------------------------");
        }
    }
}
